package com.hnevc.xiaoming.httpactivity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;

import com.hnevc.xiaoming.R;

public class MyWebView extends AppCompatActivity {

    private WebView mwbv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_web_view);

        initView();
    }

    private void initView() {
//        mwbv = findViewById(R.id.wbv);
//        mwbv.loadUrl("https://www.baidu.com");
//        WebSettings settings = mwbv.getSettings();
//        settings.setSupportZoom(true);
//        settings.setBuiltInZoomControls(true);


        mwbv=findViewById(R.id.wbv);

        StringBuilder builder = new StringBuilder();
        builder.append("<div>使用Androld创建html页面</div>");
        builder.append("<br/>");
        builder.append("<h1>肖明</h1>");
        builder.append("<h3>201965110443</h3>");
        mwbv.loadDataWithBaseURL(null,builder.toString(),"text/html","utf_8",null);

    }
}